Component({
  mixins: [],
  data: {
    day: '',
    hour: '',
    minute: '',
    second: ''
  },
  props: {
    timeStamp: 1000000
  },
  didMount() {
    let timeStamp = this.props.timeStamp;
    setInterval(() => {
      timeStamp = timeStamp - 1;
      this.timeFormat(timeStamp);
    }, 1000)
  },
  didUpdate() { },
  didUnmount() { },
  methods: {
    timeFormat(timeStamp) {
      let day = Math.floor(timeStamp / 86400);
      timeStamp = timeStamp % 86400;
      let hour = Math.floor(timeStamp / 3600);
      timeStamp = timeStamp % 3600;
      let minute = Math.floor(timeStamp / 60);
      timeStamp = timeStamp % 60;
      let second = Math.floor(timeStamp);
      this.setData({
        day: day,
        hour: hour,
        minute: minute,
        second: second
      })
    }
  },
});
